package co.edu.unal.bioingenium.kbmed.web.beans;

import co.edu.unal.bioingenium.kbmed.knowledge.visualization.VisualizationData;
import co.edu.unal.bioingenium.kbmed.knowledge.visualization.VisualizationService;
import co.edu.unal.bioingenium.kbmed.retrieval.vo.RelevantDocument;
import co.edu.unal.bioingenium.kbmed.text.representation.vo.Corpus;
import java.io.Serializable;
import java.util.List;

/**
 *
 * @author alejandro
 */
public class NavigationBean implements Serializable {

    private VisualizationService visualizationService;
    private VisualizationData visualizationData;

    /**
     * 
     */
    public NavigationBean() {
        visualizationService = VisualizationService.getInstance();
        visualizationData = new VisualizationData();
    }

    /**
     * 
     * @param results
     * @param corpus
     */
    public void initVisualizationData(List<RelevantDocument> results, Corpus corpus) {
        visualizationData = visualizationService.getVisualizationData(results, corpus);
        System.out.println(visualizationData);
    }

    /**
     * 
     * @return
     */
    public boolean visualizationDataIsloaded() {
        if (visualizationData == null) {
            return false;
        }
        return true;
    }

    /**
     * 
     * @return
     */
    public String getSubhierarchyJson() {
        return visualizationData.getSubhierarchyJson();
    }

    /**
     * 
     * @return
     */
    public String getDocumentsByDescriptorIdIndex() {
        return visualizationData.getDocumentsByDescriptorIdIndex();

    }

    /**
     * 
     * @return
     */
    public String getChildrensByParentIndex() {
        return visualizationData.getChildrensByParentIndex();
    }

    /**
     * 
     * @return
     */
    public String getDescriptorsByCategoryIndex() {
        return visualizationData.getDescriptorsByCategoryIndex();
    }
}
